import http from "../utils/ajax";

export const getBannersApi = (data) => http.get('/api/v1/banners/banners', data) // 获取首页轮播图数据
export const loginApi = (data) => http.post('/api/auth/v1/auth/wechat-login', data) // 微信登录
export const userUpdateApi = (data) => http.put('/api/users/v1/profile', data) // 更新用户资料
export const getDiscoverUserApi = (data) => http.get('/api/v1/discover', data) // 未登录获取热门用户
export const getIntelligentMatchApi = (data) => http.get('/api/v1/matching/intelligent-match', data) // 登录后获取和自己匹配的用户
export const getRecommendationsApi = (data) => http.get('/api/v1/matching/recommendations', data) // 每日推荐-系统精选用户

// 用户资料相关API
export const getUserProfileApi = () => http.get('/api/users/v1/profile') // 获取用户资料
export const updateUserProfileApi = (data) => http.put('/api/users/v1/profile', data) // 更新用户基本资料
export const getProfileCompletenessApi = () => http.get('/api/users/v1/profile/completeness') // 获取资料完整度
export const getProfileSuggestionsApi = () => http.get('/api/users/v1/profile/suggestions') // 获取资料填写建议
export const getProfileStatusApi = () => http.get('/api/users/v1/profile/status') // 获取资料审核状态

// 照片视频相关API
export const uploadPhotoApi = (data) => http.post('/api/users/v1/photos', data) // 上传照片
export const getUserPhotosApi = () => http.get('/api/users/v1/photos') // 获取用户照片
export const deletePhotoApi = (photoId) => http.delete(`/api/users/v1/photos/${photoId}`) // 删除照片
export const setPhotoAsAvatarApi = (photoId) => http.put(`/api/users/v1/photos/${photoId}/avatar`) // 设置照片为头像
export const sortPhotosApi = (data) => http.post('/api/users/v1/photos/sort', data) // 批量排序照片

// 视频相关API
export const uploadVideoApi = (data) => http.post('/api/users/v1/videos', data) // 上传视频
export const getUserVideosApi = () => http.get('/api/users/v1/videos') // 获取用户视频
export const deleteVideoApi = (videoId) => http.delete(`/api/users/v1/videos/${videoId}`) // 删除视频
export const getVideoStatsApi = () => http.get('/api/users/v1/videos/stats') // 获取视频统计数据

// 自我介绍相关API
export const updateUserIntroApi = (data) => http.put('/api/users/v1/intro', data) // 更新自我介绍
export const getUserIntroApi = () => http.get('/api/users/v1/intro') // 获取自我介绍

// 择偶要求相关API
export const updatePreferenceApi = (data) => http.put('/api/users/v1/mate-criteria', data) // 更新择偶要求
export const getPreferenceApi = () => http.get('/api/users/v1/mate-criteria') // 获取择偶要求
export const getPreferenceSuggestionsApi = () => http.get('/api/users/v1/mate-criteria/suggestions') // 获取择偶建议
export const getMatchScoreApi = (userId) => http.post('/api/users/v1/mate-criteria/match-score', { target_user_id: userId }) // 获取匹配分数

// 认证相关API
export const submitVerificationApi = (data) => http.post('/api/users/v1/verification', data) // 提交认证
export const getVerificationStatusApi = () => http.get('/api/users/v1/verification') // 获取认证状态

// 单身承诺相关API
export const submitPromiseApi = (data) => http.post('/api/users/v1/promise', data) // 提交单身承诺
export const getPromiseStatusApi = () => http.get('/api/users/v1/promise') // 获取单身承诺状态

// 互动相关API
export const likeUserApi = (userId) => http.post('/api/users/v1/like', { target_user_id: userId }) // 点赞用户
export const unlikeUserApi = (likeId) => http.delete(`/api/users/v1/like/${likeId}`) // 取消点赞
export const getLikesApi = (data) => http.get('/api/users/v1/likes', data) // 获取收到的赞
export const followUserApi = (userId) => http.post('/api/users/v1/follow', { target_user_id: userId }) // 关注用户
export const unfollowUserApi = (followId) => http.delete(`/api/users/v1/follow/${followId}`) // 取消关注
export const getFollowersApi = (data) => http.get('/api/users/v1/followers', data) // 获取粉丝列表
export const blockUserApi = (userId) => http.post('/api/users/v1/block', { target_user_id: userId }) // 拉黑用户
export const unblockUserApi = (blockId) => http.delete(`/api/users/v1/block/${blockId}`) // 取消拉黑

// 账号相关API
export const refreshTokenApi = () => http.post('/api/auth/v1/refresh') // 刷新Token
export const logoutApi = () => http.post('/api/auth/v1/logout') // 退出登录
export const deleteAccountApi = () => http.delete('/api/users/v1/account') // 注销账号
